<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
 
<%@ include file="../init_include.jsp" %>
 
<%
	int id=0,catid=0;
	String permission="100000000";	
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid",permission); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}

	String sql = "";
	String code="";
	try {	
		if(request.getParameter("catid")!=null) {
			catid=Integer.parseInt(request.getParameter("catid"));		
			Category cat=new Category(dbi,catid);
			code=cat.getModulecode();
		}			
	} catch (NumberFormatException e) {
		out.println(e);
		return ;
	}

	if(code.length()==0 || code.equals("other"))
		code=Request.getString("modulecode");
		
	CategoryInfo cInfo=new CategoryInfo(code,catid);	
	String newName[]=cInfo.getNewName();	
	String field[]=cInfo.getField();
	for(int i=0;i<field.length;i++) {
		if(request.getParameter(field[i])!=null)
			newName[i]=request.getParameter(field[i]);
		else
			newName[i]="";
	}
	cInfo.save(newName);
	out.print(Language.getNameByCode("sys.setcategoryinfosuccessful","Setting category info successfully!"));
%>
<script Language="JavaScript" src="../script/Ion_Show.js"></script> 
<script language="javascript">
	closewindow(0);
</script>	
<%@ include file="../init_free.jsp" %>